package com.xxl.job.executor.core.utils;

import java.io.File;

public class UploadFiles {

    public static void upload(String dirName,File f) {
        //连接ftp服务器并且上传文件到dirName目录下
        boolean upload = FtpUtil.uploadFile(dirName, f);
        if (upload){
            System.out.println("目录--" + dirName + "下的文件--" + f.toString() + "上传ftp服务器成功！");
            //成功后备份已上传的文件
            BackupFiles.backFile(ConfigUtil.BAKFILE + dirName + "/",f);
        }else {
            System.out.println("目录--" + dirName + "下的文件--" + f.toString() + "上传ftp服务器失败！");
        }
    }
}
